/**
 * 
 */
package simulation;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Random;

/**
 * @author chevy
 *
 */
public class RandomPAcketFactory {

	public static void main(String[] args) {
		generatePackets(args[0], args[1], args[2]);
	}
	
	public static void generatePackets(String args, String args2, String args3){
		try {
			FileWriter writer = new FileWriter(new File(args));
			
			int num = Integer.parseInt(args2);
			int packets = Integer.parseInt(args3);
			
			for(int i = 0; i < packets; i++){
				Random random = new Random();
				Random random2 = new Random();
				int r = random.nextInt(num) +1;
				int r2 = r;
				while(r2 == r){
					r2 = random2.nextInt(num) + 1 ;
				}
				//char c1 = getCharacter(r), c2 = getCharacter(r2);
				String c1 = Integer.toString(r);
				String c2 = Integer.toString(r2);
				writer.append(c1);
				writer.append(';');
				writer.append(c2);
				writer.append('\n');
			}
			writer.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
